<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="demo" index="1" class="nav">123123</div>
    <script>
        var div = document.querySelector('div');
        // 1. 返回的是一个对象
        console.log(typeof div); // Object

        // 2. 获取对象的系统自带属性
        console.log(div.id); // demo 示例 小样
        console.log(div.className); // nav
        console.log(div.getAttribute('id')); // demo

        // 4 移出属性
        div.removeAttribute('index1');
    </script>
</body>

</html>